<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <meta name="google" content="notranslate">
    <title>jk-Blog</title>
    <link rel='stylesheet' id='global-css'  href='/css/style.css?ver=4.4.2' type='text/css' media='all' />
    <script type='text/javascript' src='/script/libs.min.js?ver=4.4.2'></script>
    <script type='text/javascript' src='/script/functions.js?ver=4.4.2'></script>
    <script type='text/javascript' src='/script/common.js'></script>
    <script type="text/javascript">
    $(document).ready(function () {
        // 完成
        $(document).on("click", "#btn_regist", function(){
            var url = "http://127.0.0.1/register";
            var loginAccount = $("#loginAccount").val();
            var loginEmail = $("#loginEmail").val();
            var password = $("#password").val();
            var confirmPassword = $("#confirmPassword").val();
            if(password != confirmPassword){
                alert("密码不一致，请重新输入。");
                return;
            }
            var param = {
                    loginAccount: loginAccount
                    ,loginEmail: loginEmail
                    ,password: password
                    ,confirmPassword: confirmPassword
                };
            ajax.post(url, param, gotoLogin);
        });
      });
    
    function gotoLogin(data){
        if(data.resCode == 1){
            alert("注册成功，请登录账号。");
            window.open("index.html", "_self");
        } else {
            alert(data.resMessage);
        }
    }
    </script>
</head>
<body>
    <div id="wrap" class="wrap">
        <header id="header" class="header">
            <h1 class="logo">
                <a href="index.html"  id="admin-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="jk-Blog">
                    <label>jk-Blog</label>
                    <span class="css-arrow-bottom"></span>
                </a>
            </h1>
            <div class="right-side">
                <div class="news">
                    <a href="">
                        <label>3</label>
                        <img class="js-svg" src="images/svg/info.svg">
                    </a>
                </div>
                <div class="dropdown settings">
                    <a class="button" id="settings" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="">
                        <label class="avatar"><img src="images/logo-x.png" alt="da bai"></label>
                        <span class="css-arrow-bottom"></span>
                    </a>
                    <ul class="dropdown-menu" aria-labelledby="settings">
                        <li><a href="user-info.html">账号信息</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a class="small" href="login.html">退出</a></li>
                    </ul>
                </div>
            </div>
        </header>

        <div class="container">
            <div class="ajax-container">
                <aside class="sidebar">
                    <nav class="menu js-update-current">
                        <h2><img src="images/svg/user2.svg"> 账号管理</h2>
                        <ul>
                            <li class="current"><a href="create-account.html">创建账号</a></li>
                        </ul>
                    </nav>
                </aside>


                <section class="content create-account-content current-step-1">

                    <!-- page 1 -->
                    <fieldset class="form page-1">
                        <div class="js-validate form-inline" data-ajax-next="true">
                            <div class="form-group">
                                <label for="loginAccount">账户名称</label>
                                <input required type="text" class="form-control" id="loginAccount" name="loginAccount">
                                <p>登录账号由6位以上字母或数字组成</p>
                            </div>
                            <div class="form-group">
                                <label for="loginEmail">邮箱</label>
                                <input required type="email" class="form-control" id="loginEmail" name="loginEmail">
                                <p>安全邮箱用于接收密码或找回密码</p>
                            </div>
                            <div class="form-group">
                                <label for="password">登录密码</label>
                                <input required type="password" class="form-control" id="password" name="password">
                            </div>
                            <div class="form-group">
                                <label for="confirmPassword">确认密码</label>
                                <input required type="password" class="form-control" id="confirmPassword" name="confirmPassword">
                            </div>
                            <div class="btn-col">
                                <button id="btn_regist" class="btn btn-lg btn-info">注册</button>
                            </div>
                        </div>
                    </fieldset>
                </section>

            </div>
        </div>


    </div>
</body>
</html>
